home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
program
/
swagd_f.zip
/
DOS.SWG
/
0018_Batch Error Level.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-08-27
|
727b
|
46 lines
{
SEAN PALMER
> How would I use this Variable after I Exit the pascal Program??
You wouldn't. It won't work. What you COULD do though is to have it return an
errorlevel to Dos if you cancel...
}
Program ruSure;
Uses
Crt;
Procedure yes;
begin
TextAttr := 12;
Writeln('Okay.'); {no error here}
end;
Procedure no;
begin
TextAttr := 26;
Writeln('Aborted.');
halt(1); {report an error to Dos}
end;
begin
TextAttr := 13;
Write('Do you wish to continue? [Y/N]');
Case upcase(ReadKey) of
'Y' : yes;
'N' : no;
end;
end.
{
Now the batch file :
rusure
REM check For an error from the Program
if errorlevel 1 Goto NOPE
goto EXIT
:NOPE
cd ..
etc.